package leetcode.剑指offer.剑指II;

import org.junit.Test;

import java.util.*;

/**
 * @author ：zsy
 * @date ：Created 2021/9/25 14:34
 * @description：
 */
public class 剑指_II_001_整数除法 {
    @Test
    public void test() {
        Solution solution = new Solution();
        solution.divide(-2147483648, -1);
    }


    class Solution {
        public int divide(int a, int b) {
            double ans = (double)a / (double)b;
            if (ans < Integer.MIN_VALUE || ans > Integer.MAX_VALUE)
                return Integer.MAX_VALUE;
            int res = a / b;
            return res;
        }
    }
}
